﻿using System;
using System.IO;
using System.Windows;

namespace YsTiffConverter.DataModel
{
    /// <summary>
    /// Contains saving frames data.
    /// </summary>
    public class SaveFramesData : BaseDataObject
    {
        #region Fields

        private string folder_;
        private string fileNamePrefix_;
        private int imagePage_;
        private string fileName_;
        private bool controlsAvailable_;
        private Visibility progressBarVisibility_;
        private string sourceFileName_;
        #endregion Fields

        #region Properties

        /// <summary>
        /// Gets or sets the folder.
        /// </summary>
        public string Folder
        {
            get
            {
                return folder_;
            }
            set
            {
                folder_ = value;
                SetPropertyChanged("Folder");
            }
        }

        /// <summary>
        /// Gets or sets the file name prefix.
        /// </summary>
        public string FileNamePrefix
        {
            get
            {
                return fileNamePrefix_;
            }
            set
            {
                fileNamePrefix_ = value;
                SetPropertyChanged("FileNamePrefix");
            }
        }

        /// <summary>
        /// Gets or sets the image page (1,...).
        /// </summary>
        public int ImagePage
        {
            get
            {
                return imagePage_;
            }
            set
            {
                imagePage_ = value;
                SetPropertyChanged("ImagePage");
            }
        }

        /// <summary>
        /// Gets or sets the file name.
        /// </summary>
        public string FileName
        {
            get
            {
                return fileName_;
            }
            set
            {
                fileName_ = value;
                SetPropertyChanged("FileName");
            }
        }

        /// <summary>
        /// Gets or sets the controls availability.
        /// </summary>
        public bool ControlsAvailable
        {
            get
            {
                return controlsAvailable_;
            }
            set
            {
                controlsAvailable_ = value;
                SetPropertyChanged("ControlsAvailable");
            }
        }

        /// <summary>
        /// Gets or sets the progress bar visibility.
        /// </summary>
        public Visibility ProgressBarVisibility
        {
            get
            {
                return progressBarVisibility_;
            }
            set
            {
                progressBarVisibility_ = value;
                SetPropertyChanged("ProgressBarVisibility");
            }
        }

        /// <summary>
        /// Gets or sets the source full file name.
        /// </summary>
        public string SourceFileName
        {
            get
            {
                return sourceFileName_;
            }
            set
            {
                sourceFileName_ = value;
                SetPropertyChanged("SourceFileName");
                Folder = Path.GetDirectoryName(value);
            }
        }
        #endregion Properties

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the SaveFramesData class.
        /// </summary>
        /// <param name="fileName">The image file name.</param>
        public SaveFramesData(string fileName)
        {
            ControlsAvailable = true;
            ProgressBarVisibility = Visibility.Hidden;

            FileNamePrefix = Path.GetFileNameWithoutExtension(fileName);
            SourceFileName = fileName;
        }

        #endregion Constructors
        #region Methods

        #region Overrides
        protected override void Save()
        {
            throw new NotImplementedException();
        }

        protected override void Restore()
        {
            throw new NotImplementedException();
        }
        #endregion Overrides

        #endregion Methods

    }
}
